package com.xingfly.school.student.ohs.local.appservices;

import com.xingfly.school.course.acl.pl.response.StudentResponse;
import com.xingfly.school.student.acl.pl.request.RegistrationCourseRequest;
import com.xingfly.school.student.domain.StudentDomainService;
import com.xingfly.school.student.ohs.local.pl.response.StudentCourseInfoResponse;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * Created by SuperS on 2020/3/30.
 *
 * @author SuperS
 */
@Service
public class StudentAppService {

    @Resource
    private StudentDomainService studentDomainService;

    public List<StudentCourseInfoResponse> findCoursesByStudentId(Long studentId) {
        return studentDomainService.findCoursesByStudentId(studentId);
    }

    public Boolean registration(Long studentId, RegistrationCourseRequest request) {
        return studentDomainService.registration(studentId, request.getCourseId());
    }

    public List<StudentResponse> findStudentsByRegistrationIds(Set<Long> studentRegistrationIds) {
        return studentDomainService.findStudentsByRegistrationIds(studentRegistrationIds);
    }

    public Set<Long> findRegistrationIdsByCourseId(Long id) {
        return studentDomainService.findRegistrationIdsByCourseId(id);
    }
}
